﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

public partial class Controls_GUI_LineChart : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {}
	public void LoadData(List<List<string>> dataSource)
	{
		StringBuilder sb = new StringBuilder();

		foreach (var list in dataSource)
		{
			foreach (var item in list)
			{
				sb.Append(item);
				if(list.IndexOf(item) < list.Count-1)
					sb.Append(",");
			} 

			if(dataSource.IndexOf(list)<dataSource.Count-1)
				sb.Append("|");
		}

		string url = @"http://chart.apis.google.com/chart?chxl=0:|Jan|Feb|Mar|Jun|Jul|Aug|1:0|25|50|75|100&chxt=x,y&chs=300x150&cht=lc&chco=1E00FF,008000,FF9900&chds=-3.333,100,-5,100&chd=t:{0}&chg=25,25&chls=0.75,-1,-1|0.75,-1,-1|3,4,1&chm=x,FF000088,2,30.3,20|b,EFEFEF66,0,1,0";

		img.ImageUrl =string.Format(url, sb.ToString());
    }
}